package cn.wolfcode.luowowo.article.mapper;

import cn.wolfcode.luowowo.article.domain.Travel;
import cn.wolfcode.luowowo.article.query.TravelQuery;
import cn.wolfcode.luowowo.article.vo.StrategyStatisPersistenceVO;
import cn.wolfcode.luowowo.article.vo.TravelStatisPersistenceVO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> queryForList(TravelQuery qo);

    void changePublicValue(@Param("release") boolean release, @Param("id") Long id);

    List<Travel> getViewNumTop3(Long id);

    void updateStatisVO(TravelStatisPersistenceVO vo);

    //添加了一个方法查收数据库中有多少篇游记
    int selectCount();

    //查询阅读数量的信息
    int selectViewnum();

    //查询回复数量的信息
    int selectReplynum();

    List<Long> selectAttentionMy(long id);

    //保存游记id和用户id到中间表
    void insertUserOrTravel(@Param("id") Long id, @Param("tid") Long tid);

    List<Long> getTravelId(Long id);

    List<Travel> getTravelCollect(@Param("travelId") List<Long> travelId);

}